﻿using System;
using System.Collections.Generic;
namespace DataAccessObject
{
    public interface IDao
    {
        int Count<T>() where T : class;
        int Count<T>(NHibernate.Criterion.ICriterion expression) where T : class;
        int Count<T>(IList<NHibernate.Criterion.ICriterion> expressions) where T : class;
        void Delete(object obj);
        void Delete(string query);
        void Delete<T>(IEnumerable<object> ids);
        void Delete<T>(object id);
        void Dispose();
        int Exist<T>(NHibernate.Criterion.ICriterion expression) where T : class;
        bool Exist<T>(object id);
        IList<T> FindAll<T>(NHibernate.Criterion.Order order = null) where T : class;
        IList<T> FindBy<T>(NHibernate.Criterion.ICriterion expression, NHibernate.Criterion.Order order = null) where T : class;
        IList<T> FindBy<T>(IEnumerable<NHibernate.Criterion.ICriterion> expression, NHibernate.Criterion.Order order = null) where T : class;
        IList<T> FindBy<T>(IEnumerable<NHibernate.Criterion.ICriterion> expression, IEnumerable<NHibernate.Criterion.Order> orders) where T : class;
        IList<T> FindBy<T>(Func<T, bool> expression);
        T Get<T>(object id);
        T Load<T>(object id);
        DataAccessObject.Pagination<T> Query<T>(int pageIndex, int pageSize) where T : class;
        DataAccessObject.Pagination<T> Query<T>(int pageIndex, int pageSize, NHibernate.Criterion.ICriterion expression = null, NHibernate.Criterion.Order order = null) where T : class;
        DataAccessObject.Pagination<T> Query<T>(int pageIndex, int pageSize, IEnumerable<NHibernate.Criterion.ICriterion> expression = null, NHibernate.Criterion.Order order = null) where T : class;
        DataAccessObject.Pagination<T> Query<T>(int pageIndex, int pageSize, IEnumerable<NHibernate.Criterion.ICriterion> expression = null, IEnumerable<NHibernate.Criterion.Order> orders = null) where T : class;
        object Save(object obj);
        void SaveOrUpdate(object obj);
        NHibernate.ISession session { get; set; }
        decimal Sum<T>(string property, NHibernate.Criterion.ICriterion expression = null) where T : class;
        long SumLong<T>(string property, NHibernate.Criterion.ICriterion expression = null) where T : class;
        IList<T> Top<T>(int top, NHibernate.Criterion.ICriterion expression = null, NHibernate.Criterion.Order order = null) where T : class;
        void Update(object obj);
        int Execute(string hql);
    }
}
